package com.springboot2.kotlinexmaple.service.impl

import com.springboot2.kotlinexmaple.service.OpenstackService
import org.springframework.stereotype.Service
import org.openstack4j.openstack.OSFactory
import org.openstack4j.core.transport.Config;
import org.openstack4j.model.common.Identifier
import org.openstack4j.model.common.Identifier.byId



@Service
class OpenstackServiceImpl:OpenstackService {

    override fun authentication(endpoint: String, username: String, pwd: String, tenantName: String) {
        val config = Config.DEFAULT.withSSLVerificationDisabled()
        val domainIdentifier = Identifier.byName("default")

        val os = OSFactory.builderV3().withConfig(config)
                .endpoint(endpoint)
                .credentials(username, pwd,domainIdentifier)
                .authenticate()

    }
}